package Listeners;

import java.awt.event.ActionEvent;

import javax.swing.AbstractAction;

import GUI.AddConferencePanel;
import GUI.ConferenceWizardFrame;
import Model.ConferenceManager;

/**
 * Listener used for the "Add Conference" button in the
 * ConferenceListPanel.  Takes the user to a new JPanel
 * where they can add a new conference to the system.
 * 
 * @author Paul Schultz (ps87@uw.edu)
 * @version 11/24/2012
 */
@SuppressWarnings("serial")
public class AddConferenceListener extends AbstractAction
{
  private ConferenceManager my_manager;
  private ConferenceWizardFrame my_frame;
  
  /**
   * Constructs a new AddConferenceListener.
   * 
   * @param the_manager The ConferenceManager the conference will be added to.
   * @param the_frame The master frame for the application.
   */
  public AddConferenceListener(final ConferenceManager the_manager,
      final ConferenceWizardFrame the_frame)
  {
    my_manager = the_manager;
    my_frame = the_frame;
  }

  /**
   * Changes the panel in view to the AddConferencePanel.
   */
  @Override
  public void actionPerformed(ActionEvent arg0)
  {
    my_frame.setCurrentPanel(new AddConferencePanel(my_manager, my_frame));
  }

}
